package com.login.service;

import java.util.List;
import java.util.Map;

import net.sf.json.JSONArray;

import org.apache.log4j.Logger;

import com.login.action.fo.HotProductFO;
import com.login.dao.IHotProductDao;

public class HotProductServImpl implements IHotProductServ {
	private IHotProductDao daoHot;

	public static Logger log = Logger.getLogger(HotProductServImpl.class);

	public String searchFinaList(Map<String, Object> paraMap) {
		List<HotProductFO>  list =daoHot.searchFinaList(paraMap);
		int total = daoHot.searchFinaListNum();
		StringBuffer resultMsg = new StringBuffer("{");
		resultMsg.append("\"total\":");
		resultMsg.append(total);
		String menulist = JSONArray.fromObject(list).toString();
		resultMsg.append(",\"rows\":");
		resultMsg.append(menulist);
		resultMsg.append("}");
		log.info("==="+resultMsg.toString());
		return resultMsg.toString();
		 
	}


	public boolean deleteByIdString(String ids) {
		// TODO Auto-generated method stub
		return daoHot.deleteByIdString(ids);
		 
	}

	public boolean saveSysmenu(Map<String, Object> paraMap) {
		int num = daoHot.saveSysmenu(paraMap);
		if(num==0)
		{
		return false;
		}
		else
		{
			return true;
		}
	}


	public void setDaoHot(IHotProductDao daoHot) {
		this.daoHot = daoHot;
	}


	
	

}
